<template>
  <BaseControlTemplate
    :new-params="newParams"
    :page-view-mode="pageViewMode"
    :readonly="readonly"
    :model-value="modelValue"
    :validate-error="validateError"
    :save-dialog-config="saveDialogConfig"
  >
    <template>
      <div v-if="pageViewMode === 'print'" class="printDiv">
        {{
          newParams.data.filter((item) => {
            return modelValue2.includes(item.id)
          }).map(ro=>ro.name).join(",")
        }}
      </div>
      <el-select
        v-else
        v-model="modelValue2"
        multiple
        :placeholder="newParams.placeholder"
        @change="validateRequired"
      >
        <el-option
          v-for="item in newParams.data"
          :key="item.id"
          :label="item.name"
          :value="item.id"
          :disabled="pageViewMode !== 'runtime' || readonly"
        ></el-option>
      </el-select>
    </template>
  </BaseControlTemplate>
</template>

<script>
import mixins from "../../mixins/vue.js";
export default {
  name: "ControlMultipleSelect",
  mixins: [mixins],
  data() {
    return {
      newParams: {},
    };
  },
  methods: {},
};
</script>

